﻿<?php
ob_start();
session_start();
if(isset($_POST["name"])&&isset($_POST["password"])){
	$name=$_POST["name"];
	$password=$_POST["password"];
	$pass=md5($password);
	include '../consql/consql.php';
	include 'pre.php';
	$tableuser=$pre . "user";
	
	$cmd=mysql_query("select * from $tableuser where name='$name' and password='$pass'");
	echo $tableuser;
	if($row=mysql_fetch_array($cmd)){
		$_SESSION["user"]=$name;
		header("location:index.php");
		exit;
	}else{
		echo '登录失败！请检查用户名或密码。';
	}
}



?>
<html>
<title>RJblog-登录后台</title>
<link href="../style/default.css" rel="stylesheet" />
<body>
<center>
<div style="background:#77DDFF; color:#77DDFF">
<h1>RJblog</h1>
</div>
<div style="background:#77DDFF; color:#77DDFF">
<h2  style="background:#FFFFFF	; color:#77DDFF">登录后台</h2>
</div><h3>----进入管理后台</h3></center>
<div id="big">
<form action="" method="post">
账户：<input type="text" name="name">
密码：<input type="password" name="password"><br/><br/><br/><br/>
<center><input type="submit" class="dow" value="登录"></center>
</form>
</div>
</body>
</html>